import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)


const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    // redirect:设置默认路由
    redirect:'/product/index',
    children: [
      {
        path: '/product/index',
        component: () => import('../views/product/IndexView.vue')
      },
      {
        path: '/product/about',
        component: () => import('../views/product/AboutView.vue')
      },
      {
        path: '/product/solution',
        component: () => import('../views/product/SolutionView.vue'),
      },
      /*solution==================================================================*/
      {
        path: '/product/solution/medication',
        component: () => import('../views/product/solution/MedicationView')
      },
      {
        path: '/product/solution/marketing',
        component: () => import('../views/product/solution/MarketingView')
      },
      {
        path: '/product/solution/OAOnline',
        component: () => import('../views/product/solution/OAOnlineView')
      },
      {
        path: '/product/solution/warehouse',
        component: () => import('../views/product/solution/WarehouseView')
      },
      {
        path: '/product/solution/promotion',
        component: () => import('../views/product/solution/PromotionView')
      },
      /*===========================================================================*/

      {
        path: '/product/support',
        component: () => import('../views/product/SupportView.vue'),
      },

      {
        path: '/product/news',
        component: () => import('../views/product/NewsView.vue'),
        // redirect:设置默认路由
        redirect:'/product/news/industry',
        children: [
          {
            path: '/product/news/industry',
            component: () => import('../views/product/news/IndustryView.vue')
          },
          {
            path: '/product/news/technology',
            component: () => import('../views/product/news/TechnologyView.vue')
          },
          {
            path: '/product/news/Trends',
            component: () => import('../views/product/news/TrendsView.vue')
          },
        ]
      },
      {
        path: '/product/contact',
        component: () => import('../views/product/ContactView.vue')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})


export default router
